package demo2;

//牛客网:字符串的分类
import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String[] strs = new String[n];
        int pos = 0;
        for(int i = 0; i<n; i++) {
            char[] s = in.next().toCharArray();
            Arrays.sort(s);
            strs[pos++] = new String(s);
        }
        Arrays.sort(strs);
        int i = 0;
        int count = 0;
        while(i<n) {
            int j = i+1;
            while(j<n && strs[i].equals(strs[j])) {
                j++;
            }
            count++;
            i = j;
        }
        System.out.println(count);
    }
}